/**
 * @deprecated
 */
function hasDomAndWin() {
  if (typeof window !== "undefined" && typeof document !== "undefined") {
    return true;
  }
  return false;
}

/**
 * @deprecated
 */
function hasProcessObj() {
  if (typeof process !== "undefined") {
    return true;
  }
  return false;
}

declare type Platform = "Node" | "Browser" | "Electron";

/**
 * 获取当前的运行环境
 * @returns {"Node" | "Browser" | "Electron"} 当前运行环境
 * @deprecated use isBrowser/isServer/isNode/isElectron/isBrowserAndNode instead.
 */
function getPlatform():Platform {
  let dom = hasDomAndWin();
  let proc = hasProcessObj();
  if (dom && proc) {
    return "Electron"
  }else if (proc) {
    return "Node"
  }else{
    return "Browser"
  }
}


export {
  getPlatform
};
